///PHILOTES Source Code.  (C)2012 PhiloLabs
#pragma once

#ifndef __CompositionTargetPass_H__
#define __CompositionTargetPass_H__

#include "OgrePrerequisites.h"
#include "OgreIteratorWrappers.h"

namespace Ogre {
	
	
	
	class _OgreExport CompositionTargetPass : public MemAlloc_Resource
    {
    public:
        CompositionTargetPass(CompositionTechnique *parent);
        ~CompositionTargetPass();
        
        
        enum InputMode
        {
            IM_NONE,        // No input
            IM_PREVIOUS     // Output of previous Composition in chain
        };
        typedef vector<CompositionPass *>::type Passes;
        typedef VectorIterator<Passes> PassIterator;
        
        
        void setInputMode(InputMode mode);
        
        InputMode getInputMode() const;
        
        
        void setOutputName(const String &out);
        
        const String &getOutputName() const;
        
        
        void setOnlyInitial(bool value);
        
        bool getOnlyInitial();
        
        
        void setVisibilityMask(uint32 mask);
        
        uint32 getVisibilityMask();

		
		void setMaterialScheme(const String& schemeName);
		
		const String& getMaterialScheme(void) const;
        
		
		void setShadowsEnabled(bool enabled);
		
		bool getShadowsEnabled(void) const;
        
        void setLodBias(float bias);
        
        float getLodBias();
        
        
        CompositionPass *createPass();
        
        void removePass(size_t idx);
        
        CompositionPass *getPass(size_t idx);
        
        size_t getNumPasses();
        
        
        void removeAllPasses();
    
        
        PassIterator getPassIterator(void);
        
        
        CompositionTechnique *getParent();

        
        bool _isSupported(void);

    private:
        /// Parent technique
        CompositionTechnique *mParent;
        /// Input name
        InputMode mInputMode;
        /// (local) output texture
        String mOutputName;
        /// Passes
        Passes mPasses;
        /// This target pass is only executed initially after the effect
        /// has been enabled.
        bool mOnlyInitial;
        /// Visibility mask for this render
        uint32 mVisibilityMask;
        /// LOD bias of this render
        float mLodBias;
		/// Material scheme name
		String mMaterialScheme;
		/// Shadows option
		bool mShadowsEnabled;
    };

	
	
}

#endif
